#!/usr/bin/python

import socket,sys

print "Creating a socket"
s = socket.socket(socket.ANF_INET,socket.SOCK_STREAM)
print "done"

print "Looking up port number"
port = socket.getservbyname('http','tcp')
print "done"

print "Connecting to a remote host on port %d "% port,
s.connet(("www.google.com",port))
print "...done"

print "Connected from",s.getsockname()
print "Connected to ", s.getpeername()
